package org.example.designpattern.state;

public class LightOnState implements LightState{

    @Override
    public void on(LightContext lightContext) {
        System.out.println("灯早就开了");
    }
    @Override
    public void off(LightContext lightContext) {
        System.out.println("关灯");
        //状态切换
        lightContext.setState(lightContext.getOffState());
    }
}
